#Spiral example
wd = .02 * W
hd = .02 * H

W -= 2
H -= 2

CNTX.move_to(W + 1, 1-hd)
for i in range(25):
#    print "d"
    CNTX.rel_line_to (0, H - hd * (2 * i - 1))
    CNTX.rel_line_to (- (W - wd * (2 *i)), 0)
    CNTX.rel_line_to (0, - (H - hd * (2*i)))
    CNTX.rel_line_to (W - wd * (2 * i + 1), 0)

CNTX.set_source_rgb (0, 0, 1)
CNTX.stroke()